/* eslint-disable @typescript-eslint/no-unused-vars */
export function springEl(){
	function SUM(){
		let result = 0;
		for(let i = 0; i < arguments.length; i++){
			if(arguments[i] != undefined){
				result += arguments[i];
			}
		}
		return result;
	}
	function MIN(){
		let result;
		for(let i = 0; i < arguments.length; i++){
			if(arguments[i] != undefined){
				if(result == undefined || arguments[i] < result){
					result = arguments[i];
				}
			}
		}
		return result;
	}
	function MAX(){
		let result;
		for(let i = 0; i < arguments.length; i++){
			if(arguments[i] != undefined){
				if(result == undefined || arguments[i] > result){
					result = arguments[i];
				}
			}
		}
		return result;
	}
	function AVG(){
		const values = Array.from(arguments);
		const sum = values.reduce((acc, value) => acc + value, 0);
		return sum / values.length;
	}
	return {
		execute(expression){
			expression = expression.replace(/#([A-Z]+[0-9]*\()/g, '$1');
			try{
				return eval(expression);
			}catch(error){
				throw new Error(`执行计算公式时出错: ${error.message}`);
			}
		},
	};
}